import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('../components/Login.vue')
  },
  {
    path: '/zhuce',
    name: 'zhuce',
    component: () => import('../components/zhuce.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    meta: {
      title: '首页',
      path: "/"
    },
    children: [
      {//小区资产管理
        path: '/Asset', component: () => import('../components/Asset.vue'),
        meta: {
          title: 'Asset',
          path: "/Asset"
        }
      }
      ,
      {//投诉管理
        path: '/Complaints', component: () => import('../components/Complaints.vue'),
        meta: {
          title: 'Complaints',
          path: "/Complaints"
        }
      },
      { //小区管理
        path: '/cellinfomation', component: () => import('../components/cellinfomation.vue'),
        meta: {
          title: 'cellinfomation',
          path: "/cellinfomation"
        }
      },
      {//房产管理
        path: '/property', component: () => import('../components/property.vue'),
        meta: {
          title: 'property',
          path: "/property"
        }
      },
      {
        //保修管理
        path: '/Warranty', component: () => import('../components/Warranty.vue'),
        meta: {
          title: 'Warranty',
          path: "/Warranty"
        }
      },
      {
         //缴费明细管理
        path: '/TollDetails', component: () => import('../components/TollDetails.vue'),
        meta: {
          title: 'TollDetails',
          path: "/TollDetails"
        }
      },
      //停车管理
      {
        path: '/Parking', component: () => import('../components/Parking.vue'),
        meta: {
          title: 'Parking',
          path: "/Parking"
        }
      },
      //业主投诉
      {
        path: '/Complaints1', component: () => import('../components/Complaints1.vue'),
        meta: {
          title: 'Complaints1',
          path: "/Complaints1"
        }
      },
       //业主房产
      {
        path: '/Property_management', component: () => import('../components/Property_management.vue'),
        meta: {
          title: 'Property_management',
          path: "/Property_management"
        }
      },
       //业主停车位
       {
        path: '/Owparking', component: () => import('../components/Owparking.vue'),
        meta: {
          title: 'Owparking',
          path: "/Owparking"
        }
      },
    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
